//@ sourceURL=absentList.js
var tbAbsent = $('#absentlist');

$(function() {
    tbAbsent.datagrid({
        url: nconAbsentList + '/getAbsent',
        fit: true,
        fitColumns: true,
        rownumbers: true,
        pagination: true,
        pageSize: 20,
        pageList: [20, 30, 40],
        pagerNumber: 1,
        singleSelect: true,
        columns: [
            [{
                field: 'id',
                title: 'ID',
                // checkbox:true,
                hidden: true
            }, {
                field: 'stuname',
                title: '姓名',
                width: 50
            }, {
                field: 'weixinid',
                title: '微信ID',
                width: 50
            }, {
                field: 'startdate',
                title: '请假开始',
                width: 100
            }, {
                field:'enddate',
                title:'请假结束',
                width:100
            },{
                field:'reason',
                title:'请假原因',
                width:160
            },{
                field:'inserttime',
                title:'录入时间',
                width:100
            }]
        ],
        toolbar: '#tbAbsent',
    });
});

absent = {
    search: function() {
        tbAbsent.datagrid('load', {
            username: $.trim($('#txtAbsentUserName').val())
        });
    },
    reset: function() {
        $('#txtAbsentUserName').val('');
        tbAbsent.datagrid('load', {});
    }
};


$(document).keydown(function(e) {
    if (e.keyCode == 13) {
        absent.search();
    }
});
